<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUserProfilePersonalTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_profile_personal', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户ID');
            $table->string('real_name', 10)->default('')->comment('真实姓名');
            $table->string('id_card', 20)->default('')->comment('身份证');
            $table->string('alipay_account', 50)->default('')->comment('支付宝账号');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('1-有效，0-无效');
            $table->unique('user_id', 'user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_profile_personal');
    }
}
